package com.scu.hotelsystem.service;

import com.scu.hotelsystem.dao.RoomBusinessDao;
import com.scu.hotelsystem.pojo.RoomBusiness;
import com.scu.hotelsystem.util.RoomOccupyResult;
import com.scu.hotelsystem.util.search.RoomBusinessSearch;
import com.scu.hotelsystem.util.search.RoomOccupySearch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RoomBusinessServiceImpl implements RoomBusinessService {
    @Autowired
    private RoomBusinessDao roomBusinessDao;

    @Override
    public int addRoomBusiness(RoomBusiness roomBusiness) {
        return roomBusinessDao.addRoomBusiness(roomBusiness);
    }

    @Override
    public List<RoomBusiness> searchRoomBusinessList(RoomBusinessSearch roomBusinessSearch, int cid, int index, int limit) {
        return roomBusinessDao.searchRoomBusinessList(roomBusinessSearch,cid,index,limit);
    }

    @Override
    public List<RoomOccupyResult> searchRoomOccupyList(RoomOccupySearch roomOccupySearch, int index, int limit) {
        return roomBusinessDao.searchRoomOccupyList(roomOccupySearch,index,limit);
    }

    @Override
    public int deleteRoomBusiness(int[] idList) {
        return roomBusinessDao.deleteRoomBusiness(idList);
    }

    @Override
    public RoomBusiness searchRoomBusinessById(int id) {
        return roomBusinessDao.searchRoomBusinessById(id);
    }

    @Override
    public int updateRoomBusiness(RoomBusiness roomBusiness) {
        return roomBusinessDao.updateRoomBusiness(roomBusiness);
    }

    @Override
    public int bookToStay(int[] idList) {
        return roomBusinessDao.bookToStay(idList);
    }


}
